<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * Class CreateFamiliesTable.
 */
class CreateFamiliesTable extends Migration
{
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('families', function(Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('staff_id');
            $table->string('name');
            $table->tinyInteger('sex')->default(0);
            $table->tinyInteger('age')->nullable();
            $table->string('id_card')->nullable();
            $table->string('relationship')->comment('父母 配偶 儿女 其他');
            $table->string('dorm_type')->comment('常住 偶尔');
            $table->string('phone')->nullable();
            $table->string('remark')->nullable();
            $table->tinyInteger('status')->default(1)->comment('1 入住 0 搬出');
            $table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('families');
	}
}
